package com.study.bigwork.homework.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.study.bigwork.entity.Homework;

import com.study.bigwork.homework.dao.HomeworkDao;

@Service
@Transactional(readOnly=false)
public class HomeworkService {
	@Resource
	private HomeworkDao homeworkDao;
	//查找所有作业
	public List<Homework> getHomeworks(String tag,String homeworkType){
		return homeworkDao.getHomeworks(tag,homeworkType);
		
	}
	public List<Homework> getHomeworks(int id){
		return homeworkDao.getHomeworks(id);
		
	}
	public List<Homework> getHomeworks(int teacher_id,String tag){
		return homeworkDao.getHomeworks(teacher_id,tag);
		
	}
	//添加作业信息
	public boolean addHomework(Homework homework) {
	
		homeworkDao.addHomework(homework);
		return true;
	}
	//修改作业
	public boolean updateHomework(Homework homework) {
		homeworkDao.updateHomework(homework);
		return true;
	}
	//添加作业状态
		public boolean updateHomeworkTag(int id, int teacher_id) {
			homeworkDao.updateHomeworkTag(id, teacher_id);
			return true;
		}
	//根据tag值修改作业
		public boolean updateHomeworkInfo(int tag,Homework homework) {
			homeworkDao.updateHomeworkInfo(tag, homework);
			return true;
		
		}
		
}
